package com.itheima.controller;

import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserController {

    @Autowired
    private UserService userService;
    //配置路径
    //访问方法
    @ResponseBody   //把返回的数据当成数据处理 不会在去找页面
    @RequestMapping("/save")
    public String save(){
        userService.save();
        System.out.println(" UserController save....");
        return "{'info':'hello'}";
    }
}
